package com.windaka.elements.utils;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;


/**
 * 返回结果
 * @author song
 * @date 8:08 2022/2/19
**/
@ApiModel(value = "返回结果")
@Data
public class RetData<T> implements Serializable {

    private static final long serialVersionUID = 1905122041950251207L;

    @ApiModelProperty(value = "返回数据", example = "Object")
    private T result;

    /**
     * 静态方法 设置result值
     * @author song
     * @date 8:08 2022/2/19
     **/
    public static <T> RetData<T> result(T result) {
        RetData<T> ret = new RetData<>();
        ret.setResult(result);
        return ret;
    }
}
